<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!doctype html>
<html lang="zh" id="html">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>动态展示</title>
	<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,800,800italic,700italic" rel="stylesheet">
    <link href="<%=basePath%>static/css/feedify.min.css" rel="stylesheet">
    <link href="<%=basePath%>static/css/feedify-theme.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>static/css/default.css">
	<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<!-- 富文本  -->
	<link href="<%=basePath%>static/css/quill.snow.css" rel="stylesheet">
</head>
<body>
      <c:if test="${type == 0}">
      <div class="container">
	      <div class="row">
	        <div class="col-md-8 col-md-offset-2">
	          <div class="feedify">
	          <!-- 动态发布开始 -->
	            <section class="feedify-item">
	              <header class="feedify-item-header clearfix">
	                <c:if test="${errorstype == 0}">
	                <h5 class="pull-left"><a href="#">参数异常，请联系客服</a></h5>
	                </c:if>
	                <c:if test="${errorstype == 1}">
	                <h5 class="pull-left"><a href="#">未查询到用户，请联系客服</a></h5>
	                </c:if>
	                <c:if test="${errorstype != 0&&errorstype != 1}">
	                <img alt="" src="${logo}" class="img-circle pull-left">
	                <h5 class="pull-left"><a href="#">商家很懒，什么也没有发布</a></h5>
	                </c:if>
	                <div class="headerMesg" style="color:#000; font-weight: 800; bottom:40px; "></div>
	                <h2  class="headerMesg" style="bottom: -12px;"></h2>
	              </header>
	              <footer style="margin-top: -20px;">
	                <div class="legend">
	                <div class="feedify-item-body">
	              </div>
	              <div class="" style="text-align: center; margin-bottom: 8px; color:#000"></div>
	              <img alt="" src="<%=basePath%>images/article-1.jpg" class="img-responsive">
	                  <!-- <h4 class="pull-left"><a href="#">阿尔伯特</a></h4> -->
	                  <p class="p1"></p>
	                  <h3><a href="#"></a></h3>
	                </div>
	              </footer>
	            </section>
	            <div style="padding-bottom: 10px"><fmt:formatDate value="${nowtime}" type="date"
													        pattern="yyyy/MM/dd" /></div>
	            <!-- 动态发布结束 -->
	          </div>
	        </div>
	      </div>
	    </div>
      </c:if>
      <c:if test="${type == 1}">
      <div class="container">
	      <div class="row">
	        <div class="col-md-8 col-md-offset-2">
	          <c:forEach items="${list}" var="s" varStatus="z">
	          <div class="feedify" onclick="show('${s.id}')">
	          <!-- 动态发布开始 -->
	            <section class="feedify-item">
	              <header class="feedify-item-header clearfix">
	                <img alt="" src="${s.usersLogo}" class="img-circle pull-left">
	                <h5 class="pull-left"><a href="#">${s.theme}</a></h5>
	                <div class="headerMesg" style="color:#74777b; font-weight: 800; bottom:40px;"><h5>${s.newsName}</h5></div>
	                <h2  class="headerMesg" style="bottom: -12px;"></h2>
	              </header>
	              <footer style="margin-top: -20px;">
	                <div class="legend">
	                <div class="feedify-item-body">
	              </div>
	              <div class="" style="text-align: center; margin-bottom: 8px; color:#74777b;">${s.contenttitle}</div>
	              <img alt="" src="${s.pic}" class="img-responsive">
	                  <!-- <h4 class="pull-left"><a href="#">阿尔伯特</a></h4> -->
	                  <!-- <p class="p1">${s.newsBreviary}</p> -->
	                  <!--<h3><a href="<%=basePath%>app_companynews/app_CompanyNewsDetails?id=${s.id}">查看详情</a></h3>  -->
	                </div>
	              </footer>
	            </section>
	            <div style="padding-bottom: 10px"><fmt:formatDate value="${s.createtime}" type="date"
													        pattern="yyyy/MM/dd" /></div>
	            <!-- 动态发布结束 -->
	          </div>
	          </c:forEach>
	        </div>
	      </div>
	    </div>
	    
	  </c:if>
	<script src="<%=basePath%>static/js/jquery-2.1.1.min.js"></script>
	<script src="<%=basePath%>static/js/feedify.min.js"></script>
    <script>
    $(function() {
        var hbody = document.body.scrollHeight ;
        if(hbody < 950){
        	html.style.height = "100%";
        }
      });
    
    $(function() {
      $('.feedify').feedify();
    });

    function show(id){
    	location.href = "<%=basePath%>app_companynews/app_CompanyNewsDetails?id="+id;
    }
    
    </script>
</body>
</html>